package org.yejiali.service.impl;

import org.springframework.stereotype.Service;
import org.yejiali.service.MessageService;

import java.util.ArrayList;

/**
 * @Author:yejiali
 * @Date:2025/4/7-04-07-14:38
 * @Decsription:org.yejiali.service.impl
 * @Version:1.0
 */
@Service
public class MessageServiceImpl implements MessageService {
    private ArrayList<String> list=new ArrayList<>();
    @Override
    public void sendMessage(String message) {
        System.out.println("将消息放入消息队列中");
        list.add(message);
    }

    @Override
    public String doMessage() {
        //处理消息队列中的业务
        String message=list.remove(0);
        System.out.println("已完成业务发送短信");
        return message;
    }
}
